package com.yan.start;

import com.yan.start.bean.HelloProperties;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 自定义starter  -  默认不放在容器中
 *
 * @author shengren.yan
 * @create 2023-04-05
 */

public class HellowService {

    @Autowired
    HelloProperties helloProperties;

    /**
     * 一个方法，进行封装 ， 拼接前缀和后缀
     *
     * @param userName 用户名
     * @return {@link String}
     */
    public String sayHellow(String userName) {
        String prefix = helloProperties.getPrefix();
        String suffix = helloProperties.getSuffix();
        return prefix + " - " + userName + " - " + suffix;
    }

}
